<?php
/* @var $this InvoiceController */
/* @var $model Invoice */

$this->breadcrumbs=array(
	'Invoices'=>array('index'),
	'Create',
);

$this->menu=array(
	array('label'=>'List Invoice', 'url'=>array('index')),
);

Yii::app()->clientScript->registerScript('search', "
	$( document ).ready(function() {

	  var x= $('#po_ref').val();
	  $('#PO_ref').combogrid('setValue',x);
	  
	  if(x!='')
	  	$('#PO_ref').combogrid('disable');
	
	});

	$( '#submitBtn' ).click(function(){
		$('#po_ref').val( $('#PO_ref').combogrid('getValue'));
	});

	$('#due_date').change(function(){
		var tempDate= new Date();
		var tempDueDate=$('#due_date').val();
		tempDate.setDate(tempDate.getDate()+parseInt(tempDueDate));
		$('#result_due_date').text(tempDate.getFullYear()+'-'+tempDate.getMonth()+'-'+tempDate.getDate());
	});

");
?>

<h1>Create Invoice</h1>

<?php $this->renderPartial('_form', array('model'=>$model,'tempValue'=>$tempValue)); ?>